package javawork;
public class ComputeE {
    public static void main(String[] args) {
        for (int i = 10000; i <= 100000; i += 10000) {
            double e = 1.0;
            double item = 1.0;
            for (int j = 2; j <= i; j++) {
                item = item / j;
                e += item;
            }
            System.out.printf("When i = %d, e ≈ %f\n", i, e);
        }
    }
}